<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('pid')->default(0)->comment('上级ID')->index();
            $table->unsignedBigInteger('access_id')->default(0)->comment('关联权限');
            $table->string('name')->default('')->comment('名称');
            $table->string('route')->default('')->comment('路由');
            $table->string('url')->default('')->comment('URL');
            $table->string('icon')->default('')->comment('ICON');
            $table->unsignedTinyInteger('sort')->default(0)->comment('排序');
            $table->unsignedTinyInteger('status')->default(0)->comment('状态');
            $table->timestamps();

            $table->comment = '后台菜单表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('menus');
    }
}
